﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Student_Attachment.aspx.cs" Inherits="School.Pages.Admission.Student_Attachment" MasterPageFile="~/MasterALSafa.Master" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div align="center" dir="rtl">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <asp:Panel ID="pnlAdd" runat="server" Visible="false">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" class="admintitle">
                        ادخال مرفقات الطالب</td>
                </tr>
                <tr>
                    <td style="height: 30px; width: 153px;">
                        <asp:Label ID="Label21" runat="server" CssClass="lab" Text="اسم الطالب"></asp:Label>
                    </td>
                    <td align="right" style="height: 30px">
                        <asp:TextBox ID="txtStudentName" runat="server" CssClass="text" Width="150px" 
                            Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="height: 30px; width: 153px;">
                        وصف المرفق</td>
                    <td align="right" style="height: 30px">
                        <asp:TextBox ID="txtAttachDesc" runat="server" CssClass="text"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="height: 30px; width: 153px;">
                        الملف</td>
                    <td align="right" style="height: 30px">
                        <asp:FileUpload ID="FileUpload1" runat="server" CssClass="required" />
                        &nbsp;&nbsp;
                        </td>
                </tr>
                
                
                <tr>
                    <td colspan="2">
                        <asp:Label ID="lblMessageAdd" runat="server" CssClass="error"></asp:Label>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnSave" runat="server" CssClass="graybutton" 
                            OnClick="btnSave_Click" Text="حفظ المرفق" />

                        &nbsp;<asp:Button ID="btnCancel" runat="server" CssClass="graybutton" CausesValidation="False"
                            OnClick="btnCancel_Click" Text="تفريغ الحقول" />
                        &nbsp;<asp:Button ID="btnend" runat="server" CssClass="graybutton" CausesValidation="False"
                            OnClick="btnend_Click" Text="انهاء" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
    <div align="center" dir=rtl>
        <asp:Panel ID="pnlbrows" runat="server" Visible="true">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" class="admintitle">
                        عرض البيانات
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td style="width: 148px">
                                    &nbsp;</td>
                                <td align="right">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 153px; height: 30px;">
                                    <asp:Label ID="Label22" runat="server" CssClass="lab" 
                                        Text="اسم الطالب"></asp:Label>
                                </td>
                                <td align="right" style="height: 30px">
                                    <asp:TextBox ID="txtStudentName1" runat="server" CssClass="text" Width="150px" 
                                        Enabled="False"></asp:TextBox>

                                </td>
                            </tr>
                            <tr>
                                <td style="height: 30px; width: 153px;">
                                    وصف المرفق</td>
                                <td align="right" style="height: 30px">
                                    <asp:TextBox ID="txtSearchAttachDesc" runat="server" CssClass="text"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="btnSearch" runat="server" Text="بحث" CssClass="graybutton" OnClick="btnSearch_Click" />&nbsp;<asp:Button 
                                        ID="btnAdd" runat="server" CssClass="graybutton" OnClick="btnAdd_Click" 
                                        Text="اضافة جديد" />
                                    &nbsp;<asp:Button
                                        ID="btnGetAll" runat="server" Text="الكل" CssClass="graybutton" OnClick="btnGetAll_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Label CssClass="lableface" ID="lblRecordNo" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:GridView Width="60%" AllowPaging="True" AllowSorting="True" ID="griddata" runat="server"
                                        CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                                        PagerStyle-CssClass="GridPager" 
                                        AlternatingRowStyle-CssClass="GridItemAltername" 
                                        AutoGenerateColumns="False" 
                                        onselectedindexchanged="griddata_SelectedIndexChanged" 
                                        OnRowDeleting="griddata_RowDeleting" DataKeyNames="Id" 
                                        onrowdatabound="griddata_RowDataBound" 
                                        onpageindexchanging="griddata_PageIndexChanging">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:BoundField DataField="Attach_Description" HeaderText="وصف المرفق" />
                                            <asp:BoundField DataField="AttachFileName" HeaderText="اسم الملف" />
                                            <asp:CommandField ShowSelectButton="True" SelectText="View" Visible="False" />
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <a href='<%# "../StudentAttach/" + Eval("Student_Id").ToString() + "/" + Eval("AttachFileName").ToString()%>'>
                                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/file.gif" />
                                                    </a>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField ShowHeader="False">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                                                        Text="Delete"></asp:LinkButton>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>

                                            

                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Label CssClass="error" ID="lblMessage" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
</asp:Content>
